#include <stdio.h>
#include <vector>
#include <unordered_map>
#include <iostream>

using namespace std;

typedef unordered_map <int,int> unoMapInt;
class Solution{
    public:
    vector <int> twoSum (vector<int>& nums,int target){
        unoMapInt hash;
        vector<int> result;
        for (int i = 0; i < nums.size();i++){
            int numToFind = target - nums[i];
            if(hash.find(numToFind) != hash.end()){
                result.push_back(hash[numToFind]);
                result.push_back(i);
            }
            hash[nums[i]] = i;
        }
        return result;
    }
};

int main (){
    Solution s;
    vector<int> result;
    vector<int> nums;
    int a[5] = {1,2,3,4,5};
    for(int i= 0 ; i < 6;i++){
        nums.push_back(a[i]);
    }
    result = s.twoSum(nums,9);
    for(int i = 0; i < result.size();i++){
        cout << result.at(i);
    }
    return 0;
}